package com.example.recycler.bsr;

import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.Path;
import android.util.AttributeSet;
import android.view.View;

/**
 * Created by Administrator on 2017/3/16.
 */

public class BsView extends View{
    private Paint mPaint=new Paint();
    public BsView(Context context) {
        super(context);
    }

    public BsView(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    @Override
    protected void onDraw(Canvas canvas) {
        super.onDraw(canvas);
        mPaint.setColor(Color.BLUE);
        mPaint.setStrokeWidth(5);
        mPaint.setStyle(Paint.Style.STROKE);
        Path path=new Path();
        Path path1=new Path();
        path.moveTo(0,100);
        path.lineTo(100,0);
        path.lineTo(300,200);
        path.lineTo(400,100);
        path1.moveTo(0,100);
        path1.quadTo(100,0,200,100);
        path1.quadTo(300,200,400,100);
        canvas.drawPath(path,mPaint);
        canvas.drawPath(path1,mPaint);
    }
}
